<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\ResourceCollection;

class CarCollection extends ResourceCollection
{
    public function toArray($request)
    {
        $collection = $this->collection;
        $collection->each(function ($info) {
            $info->appraisal_rept = $info->appraisal_report;
        });
        return [
            'data' => $collection
        ];
    }
}
